<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableRole extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('roles', function (Blueprint $table) {
            $table->increments('id');
            $table->char('code', 20)
                ->default('')
                ->comment('角色编码');
            $table->string('name', 20)
                ->default('')
                ->comment('角色名称');
            $table->string('remark')
                ->default('')
                ->comment('角色描述');
            $table->tinyInteger('is_disabled')
                ->default('0')
                ->comment('是否禁用 0否 1是');
            $table->timestamps();

            $table->index('is_disabled');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('roles');
    }
}
